package com.frejoys.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.frejoys.common.aop.Authority;
import com.frejoys.common.aop.Authorization;
import com.frejoys.common.constant.CommonConstant;
import com.frejoys.common.dto.admin.UserLevelMoneyListDto;
import com.frejoys.common.dto.admin.UserLevelMoneyLogListDto;
import com.frejoys.common.dto.admin.UserLevelStoreMoneyListDto;
import com.frejoys.common.dto.admin.UserLevelStoreMoneyLogListDto;
import com.frejoys.common.response.Result;
import com.frejoys.common.vo.admin.UserLevelMoneyListVo;
import com.frejoys.common.vo.admin.UserLevelMoneyLogListVo;
import com.frejoys.common.vo.admin.UserLevelStoreMoneyListVo;
import com.frejoys.common.vo.admin.UserLevelStoreMoneyLogListVo;
import com.frejoys.service.UserLevelMoneyLogService;
import com.frejoys.service.UserLevelMoneyService;
import com.frejoys.service.UserLevelStoreMoneyLogService;
import com.frejoys.service.UserLevelStoreMoneyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "用户店铺推广收益", description = "用户店铺推广收益")
@RestController
@RequiredArgsConstructor
@RequestMapping(CommonConstant.routePrefixAdmin)
@Authorization(Authority.Private)
public class AdminUserLevelStoreMoneyController {

    private final UserLevelStoreMoneyService userLevelStoreMoneyService;

    private final UserLevelStoreMoneyLogService userLevelStoreMoneyLogService;

    @PostMapping("/userLevelStoreMoney/userLevelStoreMoneyListInfo")
    @Operation(summary = "'用户店铺推广收益列表")
    public Result<IPage<UserLevelStoreMoneyListVo>> userLevelStoreMoneyListInfo(@RequestBody @Validated UserLevelStoreMoneyListDto dto){
        return Result.success(userLevelStoreMoneyService.userLevelStoreMoneyListInfo(dto));
    }


    @PostMapping("/userLevelStoreMoney/userLevelStoreMoneyLogListInfo")
    @Operation(summary = "用户店铺推广收益明细列表")
    public Result<IPage<UserLevelStoreMoneyLogListVo>> userLevelStoreMoneyLogListInfo(@RequestBody @Validated UserLevelStoreMoneyLogListDto dto){
        return Result.success(userLevelStoreMoneyLogService.userLevelStoreMoneyLogListInfo(dto));
    }
}
